package james.education;
import java.awt.BorderLayout;
import java.awt.Color;
import java.net.URL;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class OldFlashCardApp  {
	
	public static void main(String args []) {
		JFrame frame = new FlashCardFrame("");
		frame.setSize(300,300);
		
		ImagePanel imgPanel = new ImagePanel();
		JPanel wordPanel = new JPanel();
		JPanel ctrPanel = new JPanel();
		
		ImageIcon image1 = 
			new ImageIcon("C:/Documents and Settings/b1405035/My Documents/My Pictures/1996-rookies.jpg","rookies");
		ImageIcon image2 = null;
		try {
			System.out.println("getting image url");			
			image2 = new ImageIcon(new URL("http://inside.boeing.com/_images/logo90bw.gif"),"boeing");
			System.out.println("completed getting image url");
			System.out.println("image desc: " + image2.getDescription());
		}
		catch (Exception e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		}
		
		wordPanel.setBackground(Color.WHITE);
		JLabel label = new JLabel(image1.getDescription());		
		label.setBackground(Color.WHITE);
		wordPanel.add(label);
		
		imgPanel.setImage(image1.getImage());
		imgPanel.validate();

		ctrPanel.add(wordPanel);
		ctrPanel.add(imgPanel);
		
		frame.getContentPane().add(imgPanel, BorderLayout.CENTER);
		frame.getContentPane().add(wordPanel,BorderLayout.WEST);
		frame.getContentPane().add(new JLabel("flash app"),BorderLayout.NORTH);
		
		frame.validate();
		frame.setVisible(true);
		
	}
	
	protected ImageIcon createImageIcon(String path,
			String description) {
		java.net.URL imgURL = getClass().getResource(path);
		if (imgURL != null) {
			return new ImageIcon(imgURL, description);
		} else {
			System.err.println("Couldn't find file: " + path);
			return null;
		}
	}


}
